package project.innovation.mooddiagnosis.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import project.innovation.mooddiagnosis.entity.message.MessageInfo;
import project.innovation.mooddiagnosis.entity.result.Result;
import project.innovation.mooddiagnosis.service.MessageService;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/message")
public class MessageController {
    @Autowired
    private MessageService messageService;

    /**
     * AI对话的历史信息接口
     * @param userId 用户userId
     * @return 用户的全部对话历史信息，格式为messageInfo
     */
    @GetMapping("/list")
    public Result messageInfoList(@RequestParam("userId") String userId){
        return new Result(200, "messageInfo list success", messageService.messageInfoList(userId));
    }
}
